<?php
namespace Home\Controller;
use Think\Controller;


class NewsController extends Controller {

	//http://10.110.5.87:8888/NongGuoGuo/index.php/home/News/inqurieNews
    //分类查询新闻
    function inqurieNews($typeid){
     $news=M("News");
     // $typeid=$_POST["typeid"];
     $data=$news->field("t_news.news_image,t_news.news_title,t_news.news_desc") 
        ->join("t_newsclassify on t_news.newsclassify_id=t_newsclassify.newsclassify_id")
        ->where(" t_news.newsclassify_id='$typeid'")
        ->select();

        if ($data) {
    		$this->ajaxReturn(array(
                "code"=>200,
                "message"=>"查询成功！",
                "data"=>$data
    			),"JSON");
    	}else{
    		$this->ajaxReturn(array(
                "code"=>500,
                "message"=>"没有相应新闻！"
    			),"JSON");
    	}


    }







}